import request from "@/utils/request"


/**
 * 
 * @param {object} params 
 * @param {string} params.username 用户username
 * @param {number} params.uid 用户id
 * @returns 
 */
export const getUserListApi = (params = {}) => {
    return request.get('/user/', { params })
}

export const createUserApi = (data) => {
    return request.post('/user/', data)
}

export const updateUserApi = (data) => {
    return request.patch(`/user/`, data)
}
/**
 * 
 * @param {*} data 
 * @param {string} data.username 用户username
 * @returns 
 */
export const deleteUserApi = (data) => {
    return request.delete(`/user/`, {
        data
    })
}
export const changePasswordApi = (data) => {
    return request.patch('/user/', data)
}